import { PropsWithChildren, useMemo } from "react";

interface IViewProps {
  className?: string;
  row?: boolean;
}
export function View(props: PropsWithChildren<IViewProps>) {
  const { row } = props;
  
  const className = useMemo(() => {
    const clsnames = ['flex']

    if (row) {
      clsnames.push('flex-row')
    } else {
      clsnames.push('flex-col')
    }
    return clsnames.join(' ')
  }, [row])
  
  return <div className={className}>{props.children}</div>;
}
